package org.etnetwork.core.io;

import com.google.common.base.Preconditions;
import org.etnetwork.core.AbstractGraph;
import org.etnetwork.core.Edge;
import org.etnetwork.core.Graph;

import java.util.Iterator;

public class InputFile implements Input{

    @Override
    public AbstractGraph fromEdgeList(AbstractGraph graph) {
//        Graph g = new Graph();
//        Preconditions.checkArgument(source.size() == target.size(),
//                String.format("The size of the source nodes list should be the same as the target nodes list, but get sources: %d, target: %d",
//                        source.size(),
//                        target.size()));
//
//        Iterator<Long> sourceIter;
//        Iterator<Long> targetIter;
//        sourceIter = source.listIterator();
//        targetIter = target.listIterator();
//
//        int lineNum = 0;
//        while (sourceIter.hasNext() && targetIter.hasNext()) {
//            lineNum ++;
//            Long s = sourceIter.next();
//            Long t = targetIter.next();
//            try {
//                g.addEdge(new Edge(s, t));
//            } catch (IllegalArgumentException e) {
//                System.out.printf("Illegal parameter occurs in line %d%n", lineNum);
//                throw e;
//            }
//        }
        return graph;
    }


    @Override
    public AbstractGraph fromAdj(AbstractGraph graph) {
        return graph;
    }
}
